<?php
	include 'connect.php';
 	if (isset($_GET['id']) && is_numeric($_GET['id']) && $_GET['id'] > 0) {
 		$id = $_GET['id'];
		$result = mysql_query("SELECT * FROM articoli WHERE id=$id") or die(mysql_error()); 
		$row = mysql_fetch_array($result);
	 	if($row) {
			$titolo = $row['titolo'];
			$articolo = $row['articolo'];
	 	}
	}
?>
			<script type="text/javascript" src="./plugin/tinymce/tiny_mce.js"></script>
            <script type="text/javascript" src="./plugin/tinymce/setting.js"></script>
        	<script type="text/javascript" src="./plugin/validation/jquery.js"></script>
            <script type="text/javascript" src="./plugin/validation/jquery.validate.js"></script>
	 		<div id="info-bar-large">Modifica articolo</div> 
	 		<div id="post-box">
		 		<form method="post" action="./includes/action_edit_post.php?id=<?=$id;?>">
					 <input type="text" name="titolo" value="<?php echo $titolo; ?>" class="box-post-title" required /><br/>
					 <textarea name="articolo" class="post-text">
					 	<?php echo $articolo; ?>
					 </textarea>
					 <br>
					 <p><input type="submit" name="submit" value="Salva Modifiche" class="post-button"></p>
		 		</form> 
	 		</div>